package cn.lcsjsxy.yxz.keywords.super_;

public class Student extends Person {

    String major;
    int id = 28; // 学号

    public Student() {
        //super();
    }

    public Student(String major) {
        //super();
        this.major = major;
    }

    public Student(String name,int age,String major){
//        this.name = name;
//        this.age = age;
        super(name,age);
        this.major = major;
    }

    public void eat() {
        System.out.println("学生要多吃有营养的东西!");
    }

    public void study() {
        System.out.println("要多学知识!");
        this.eat();   //如果不输入的话,默认都是this
        super.eat();
        super.walk();
    }

    public void show() {
        System.out.println("name + " + this.name + " , age = " + super.age);
        System.out.println("id = " + this.id);    //         默认都是this
        System.out.println("id = " + super.id);
    }

}
